import { request } from '@umijs/max';
// 名人信息
export interface FamousPersonInfo {
  id: number;
  name: string;
  pinyin: string;
  englishName: string;
  introduction: string;
  imageId: number;
  birthDate: string;
  constellation: string;
  zodiac: string;
  specialTalent: string;
  nationality: string;
  gender: string;
  occupation: string;
  hobbies: string;
  fansName: string;
  supportColor: string;
}

// 获取名人信息
export async function getFamousPersonInfo(id: number) {
  return request<FamousPersonInfo>(`/famous-persons/${id}`, {
    method: 'GET',
  });
}

// 更新名人信息
export async function updateFamousPersonInfo(
  famousPersonInfo: FamousPersonInfo,
) {
  return request<FamousPersonInfo>('/famous-persons/back', {
    method: 'PUT',
    data: famousPersonInfo,
  });
}
